package com.burstly.lib.component.networkcomponent.burstly;

import android.content.Context;
import android.content.Intent;
import com.burstly.lib.component.AbstractAdaptor;
import com.burstly.lib.component.ComponentState;
import com.burstly.lib.component.IBurstlyAdaptorListener;
import com.burstly.lib.component.IClickTracker;
import com.burstly.lib.component.ITrackClickResponseHandler;
import com.burstly.lib.component.activitylauncher.IActivityLauncherSource;
import com.burstly.lib.network.beans.RequestData;
import com.burstly.lib.network.beans.ResponseBean;
import com.burstly.lib.network.beans.ResponseBean.ResponseData;
import java.util.Map;

public abstract class AbstractBurstlyAdaptor extends AbstractAdaptor
  implements IActivityLauncherSource, IClickTracker
{
  private ComponentState mState;

  public AbstractBurstlyAdaptor(Context paramContext, String paramString)
  {
    super(paramContext, paramString);
  }

  public void beforeLaunch()
  {
  }

  protected void checkParameters(Map<String, ?> paramMap)
    throws IllegalArgumentException
  {
    this.mState = ((ComponentState)paramMap.get("componentState"));
  }

  public void destroy()
  {
    super.destroy();
    this.mState = null;
  }

  protected ResponseBean getFullResponse()
  {
    return this.mState.getFullResponse();
  }

  public Intent getIntent()
  {
    Intent localIntent = new Intent(getContext(), BurstlyFullscreenActivity.class);
    Integer localInteger = this.mState.getResponseData().getSkipButtonActivationTime();
    if (localInteger != null)
      localIntent.putExtra("blockBackButton", 1000 * localInteger.intValue());
    return localIntent;
  }

  protected RequestData getRequestData()
  {
    return this.mState.getRequestData();
  }

  protected ResponseBean.ResponseData getResponseData()
  {
    return this.mState.getResponseData();
  }

  public ITrackClickResponseHandler getResponseHandler()
  {
    return new ClickResponseHandler(getContext(), this.mState);
  }

  protected ComponentState getState()
  {
    return this.mState;
  }

  public boolean isAllowedToLaunch()
  {
    return true;
  }

  public void onActivityNotFound(String paramString)
  {
  }

  public void onFailToLaunch(String paramString)
  {
    getAdaptorListener().failedToLoad(getNetworkName(), true, paramString);
  }

  public void onSuccesToLaunch()
  {
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.AbstractBurstlyAdaptor
 * JD-Core Version:    0.6.2
 */